home *** CD-ROM | disk | FTP | other *** search
- Out of Environment Space
-
- When running a BATch file from a "shell" there may be problems with
- "Out of Environment space" since DOS does not usually allocate excess
- Environment space to child processes. 4DOS and its alter-ego NDOS
- provide a means to ensure that copies of the Environment have
- sufficient space available, but COMMAND.COM is very stingy with the
- amount of free Environment space it allocates to child processes.
- Check the documentation for your shell program to see if it can make
- sufficient Environment space available. If you plan on running a
- BATch file from a shell and find that "Out of environment space" is a
- problem, there are several things that you can try to do.
-
- If COMMAND.COM is your command processor, in order to run your.bat
- you can tell your shell to use the command, C:\COMMAND.COM /E:512 /
- Cyour.bat. Assuming that COMMAND.COM is in the root directory of the
- C: drive, this will allocate 512 bytes of Environment space to your
- BATch file. Just adjust the command for the proper location of your
- COMMAND.COM and the actual amount of Environment space you will need
- with the /E: switch.
-
- If your shell won't cooperate in running COMMAND.COM in this manner,
- then you can establish a BATch file to do it for you. Call it
- RUNBATCH.BAT and make the first line %COMSPEC% /E:512 /C%1 %2 %3 etc.
- Then when you want to run your.bat, tell your shell to execute the
- command RUNBATCH your.bat. Follow that with any parameters you need
- for your.bat and they will be picked up by the %1 %2 %3 etc.
- replaceable parameters in RUNBATCH.BAT.
-
- Another method to ensure that GET has enough Environment space to
- store its results is to establish a dummy GET variable before loading
- any shells or other programs. The best way would be to do it in your
- AUTOEXEC.BAT. Simply insert the command SET GET=xxxxx...xxxx in your
- AUTOEXEC.BAT file with enough x's or other characters for the maximum
- length input string you are expecting. Then in any BATch file that is
- to be run from the shell, before using GET issue the command SET
- GET=. This will remove the GET variable from the Environment and
- free the space to be reused by GET.